<template>
    <div>
        <h1>A component</h1>
        <comp-textb ref="BRef"
                    myname="张三" 
                    @myhandle="aHandle"
                    :height="'177cm'"
                    :age="25">
        </comp-textb>
        <button @click="getBRef">A点击</button>


    </div>
</template>

<script>
import CompTextb from "./CompTextb.vue";
import MyEvent from "./MyEvent.js";
    export default{
        provide: {
            myname: "A组件的provide"
        },
        name: "CompTexta",
        data(){
            return{

            }
        },
        components:{
            CompTextb
        },

        created(){
            MyEvent.$on("cHandle",function(arg){
                console.log(arg);
            })
        },
        methods:{
            aHandle(arg){
                console.log("触发到了A",arg)
            },
            getBRef(){
                // console.log(this.$refs.BRef.age);
                console.log(this.$children[0].age)
            }
        }
    }
</script>

<style>
</style>